# -*- codeing = utf-8 -*-
# @Time : 2021/2/22 18:53
# @Atuthor: 朱朱
# @File: 050列表的嵌套.py
# @Software: PyCharm
# 一个学校，有3个办公室，现在有10位老师等待工位的分配，请编写程序，完成随机的分配
import random

teachers = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J']
rooms = [[], [], []]

for teacher in teachers:
    # choice 从一个非空列表里,随机选择一个元素
    room = random.choice(rooms)
    room.append(teacher)
# print(rooms)

for i,room in enumerate(rooms):
    print(f'{i}房间里一共有{len(room)}个老师,')
    for teacher in room:
        print(teacher,end='  ')
    print()